Add Support for Loading Environment Variables from .env Files #311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello
Telmate/proxmox-api-go
maintainers,I am just starting to contribute to the Proxmox ecosystem. I want to see a nice and useful terraform provider and do my part to it. As I learned now the
Telmate/proxmox-api-go
is the first crucial thing and I cloned the repo to play around with it to get started.My Motivation:
When it came to exporting environment variables to setup the configuration, I thought
.env
files would be a nice thing to have. I usually have multiple small projects ongoing at the same time and always having to typeexport KEY=value
is error prone and as it is part of the bash history also insecure.Implementation:
To address this, I have integrated the
godotenv
package, which allows the application to automatically load environment variables from a.env
file at runtime. This means users can now store their sensitive credentials safely in.env
files, significantly reducing the risk of accidental exposure, mixing up things etc. I also added.env
to the gitignore file, everybody should know that this is a sensitive file which must not be shared.Changes Made:
godotenv
as a dependency ingo.mod
..env
file loading logic in the main initialization section of the application..env
files with the Proxmox API Go client.Thank you for considering my PR.